import request from '@/utils/request'
// 登录
export const loginApi = ({ username, password }) => {
  return request.post('/park/login', {
    username,
    password
  })
}
// 获取用户信息
export const getUserApi = () => {
  return request.get('/system/user/dropList')
}
// 获取月卡管理信息
export const getMonthCardApi = (params) => {
  return request.get('/parking/card/list', {
    params
  })
}

// 新增月卡
export const addMonthCardApi = (data) => {
  return request.post('/parking/card', data)
}

/**
 * 获取月卡详情
 * @data
 * @returns
 */
export const getCardDetailAPI = (id) => request.get(`/parking/card/detail/${id}`)

/**
 * 更新月卡
 * @param {*} data
 * @returns
 */
export const updateCardAPI = (data) => request.put('/parking/card/edit', data)

/**
 * 删除月卡
 * @param {*} id
 * @returns
 */
export const delCardAPI = (id) => request.delete(`/parking/card/${id}`)

/**
 * 批量删除月卡
 * @param {*} ids [1,2,3]
 * @returns
 */
export const delAllCardAPI = (ids) => request.delete(`/parking/card/${ids.join(',')}`)
